<template>
  <div class="app-container">
    <div class="container-bg">
      <el-tabs class="config_box" v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="有线网络" name="wiredNetwork">
          <wired-network v-if="activeName == 'wiredNetwork'"></wired-network>
        </el-tab-pane>
        <el-tab-pane
          label="无线网络"
          name="wirelessNetwork"
          v-if="isShow.WiFi == 1"
        >
          <wireless-network
            v-if="activeName == 'wirelessNetwork'"
          ></wireless-network>
        </el-tab-pane>
        <el-tab-pane label="门禁平台" name="cloudGate" v-if="false">
          <cloud-gate v-if="activeName == 'cloudGate'"></cloud-gate>
        </el-tab-pane>
        <el-tab-pane label="RTSP参数" name="rtspConfig" v-if="false">
          <rtsp-config v-if="activeName == 'rtspConfig'"></rtsp-config>
        </el-tab-pane>
        <el-tab-pane label="GB28181" name="Set28181" v-if="isShow.gb28181 == 1">
          <Set28181 v-if="activeName == 'Set28181'"></Set28181>
        </el-tab-pane>
        <el-tab-pane
          label="GA/T 1400协议"
          name="Set1400"
          v-if="isShow.ga1400 == 1"
        >
          <Set1400 v-if="activeName == 'Set1400'"></Set1400>
        </el-tab-pane>
        <el-tab-pane label="视频协议" name="externalDevice">
          <external-device
            v-if="activeName == 'externalDevice'"
          ></external-device>
        </el-tab-pane>
        <el-tab-pane label="云端识别平台" name="thirdPlatform">
          <third-platform v-if="activeName == 'thirdPlatform'"></third-platform>
        </el-tab-pane>
        <el-tab-pane
          label="媒体服务"
          name="mediaConfig"
          v-if="false"
        >
          <media-config v-if="activeName == 'mediaConfig'"></media-config>
        </el-tab-pane>
        <!-- <el-tab-pane label="万睿平台" name="fourthPlatform">
          <fourth-platform v-if="activeName == 'fourthPlatform'"></fourth-platform>
        </el-tab-pane> -->

        <!-- <el-tab-pane label="网络设置" name="ten" v-if="false"
          ><show-config :info="showInfo"></show-config>
        </el-tab-pane> -->
        <el-tab-pane label="日志设置" name="a" v-if="false">
          <log-config></log-config>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<script>
import { getDeviceInfoDetailsApi } from "@/api/network";
//   import timeSet from "./sub/timeSet.vue";
import wirelessNetwork from "./sub/wirelessNetwork.vue";
import wiredNetwork from "./sub/wiredNetwork.vue";
import ShowConfig from "./sub/showConfig.vue";
// import monitorConfig from "./sub/monitorConfig.vue";
import logConfig from "./sub/logConfig.vue";
import cloudGate from "./sub/cloudGate.vue";
import rtspConfig from "./sub/rtspConfig.vue";
import Set28181 from "./sub/Set28181.vue";
import Set1400 from "./sub/Set1400.vue";
import externalDevice from "./sub/externalDevice.vue";
import thirdPlatform from "./sub/thirdPlatform.vue";
// import fourthPlatform from "./sub/fourthPlatform.vue";
import mediaConfig from "./media-services";

export default {
  components: {
    wiredNetwork,
    ShowConfig,
    // monitorConfig,
    logConfig,
    cloudGate,
    rtspConfig,
    Set28181,
    Set1400,
    wirelessNetwork,
    externalDevice,
    thirdPlatform,
    // fourthPlatform,
    mediaConfig,
  },
  data() {
    return {
      activeName: "wiredNetwork",
      baseInfo: {},
      timeSet: {},
      showInfo: {},
      machineList: [],
      isShow: {
        WiFi: 1,
        gb28181: 0,
        ga1400: 0,
        advertisement: 0,
      },
    };
  },
  created() {
    this.getDeviceInfoDetails();
  },
  methods: {
    handleClick() {},
    requestData() {},
    resetForm() {
      this.$refs["elForm"].resetFields();
    },
    getDeviceInfoDetails() {
      getDeviceInfoDetailsApi().then((res) => {
        // console.log(res);
        // this.isShow.WiFi = res.peripheral.WiFi.exists;
        this.isShow.gb28181 = res.software.gb28181.value;
        this.isShow.ga1400 = res.software.ga1400.value;
        this.isShow.advertisement = res.software.advertisement.exists;
        // console.log(this.isShow);
      });
    },
  },
};
</script>

<style lang="scss" scoped>
/deep/ .el-tabs__header {
  margin: 0 0 30px;
}
</style>
